package cn.edu.scau.cmi.chenyipeng.Adapter;

import java.util.ArrayList;
import java.util.List;

public class AdapterOfClass extends SortUtil implements Target{
	
	@Override
	public ArrayList<Student> sort(UnsortedStudents all){
		ArrayList<Student> sortedStudents = new ArrayList<Student>();
		Student temp;
		List<Integer> sortedID = super.idSort(all.getAllID());
		for(int i = 0; i < sortedID.size(); ++i) {
			temp = all.getALL().get(all.search(sortedID.get(i)));
			sortedStudents.add(temp);
		}
		return sortedStudents;
	}

	
}
